//
//  TrackEventAnnotationView.m
//  location
//
//  Created by Dongxiang Xu on 2024/5/22.
//

#import "TrackEventAnnotationView.h"

@implementation TrackEventAnnotationView

- (instancetype)initWithAnnotation:(nullable id <MKAnnotation>)annotation reuseIdentifier:(nullable NSString *)reuseIdentifier
{
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    
    if (self)
    {
        self.bounds = CGRectMake(0.f, 0.f, 24, 24);
                        
        UIImageView *head = [[UIImageView alloc] initWithFrame:CGRectMake(8, 8, 8, 8)];
        [self addSubview:head];
        _subLayer = [CALayer layer];
        _subLayer.frame = head.bounds;
        _subLayer.cornerRadius = 4;
        _subLayer.masksToBounds = NO;
        _subLayer.backgroundColor = RealWhiteColor.CGColor;
        _subLayer.shadowColor = RealBlackColor.CGColor;
        _subLayer.shadowOffset = CGSizeMake(0,2);
        _subLayer.shadowOpacity = 0.3;
        _subLayer.shadowRadius = 3;
        [head.layer addSublayer:_subLayer];
        _mapImg = [[UIImageView alloc] initWithFrame:CGRectMake(2, 2, 4, 4)];
        _mapImg.layer.masksToBounds = YES;
        [_mapImg.layer setCornerRadius:2];
        [head addSubview:_mapImg];
    }
    
    return self;
}

@end
